package org.example.service.impl;

import jakarta.annotation.Resource;
import org.example.entity.Auccount;
import org.example.mapper.AuccoutMapper;
import org.example.service.AccountService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class AccountServiceImpl implements AccountService {
   @Resource
   private AuccoutMapper auccoutMapper;
    @Override
    @Transactional
    public void debit(String userId, int money) {
        auccoutMapper.debit(new Auccount(null, userId, money));
    }
    @Override
    public void insert(String userId, int money) {
       auccoutMapper.insert(new Auccount(null, userId, money));
    }
}
